package edu.rit.teamrocket.view;

import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class AddRecipe extends JFrame
{
   private JLabel recipeName, quantity;
   private JTextField quantityText;
   private JPanel panel1, panel2, panel3;
   private JButton add, done, cancel;
   private JTextArea textArea;
   private GridLayout grid;
   private JComboBox recipe;
   
   public AddRecipe()
   {
      super("Add Recipe");
      grid = new GridLayout(0,1, 5, 5);
      recipeName = new JLabel("Recipe Name: ");
      textArea = new JTextArea(10, 20);
      add = new JButton("Add");
      add.addActionListener(new ActionListener() {
 
            @Override
			public void actionPerformed(ActionEvent e)
            {
                System.out.println("You clicked the button");
            }
            });

      done = new JButton("Done");
      done.addActionListener(new ActionListener() {
 
            @Override
			public void actionPerformed(ActionEvent e)
            {
                System.out.println("You clicked the button");
            }
            });

      cancel = new JButton("Cancel");
      cancel.addActionListener(new ActionListener() {
 
            @Override
			public void actionPerformed(ActionEvent e)
            {
                System.out.println("You clicked the button");
            }
            });

      quantity = new JLabel("Quantity: ");
      quantityText = new JTextField(10);
      
      //ArrayList<String> comboBoxRecipe = new ArrayList<String>();
      //comboBoxRecipe.add("food1");
      
      String[] comboBoxRecipe = {"","","","",""};
      recipe = new JComboBox(comboBoxRecipe);
      
      panel1 = new JPanel();
      this.add(panel1, BorderLayout.NORTH);
      panel1.add(textArea);
      
      panel2 = new JPanel();
      this.add(panel2, BorderLayout.CENTER);
      panel1.setLayout(new GridLayout(0,1,5,5));
      panel2.add(recipeName);
      panel2.add(recipe);
      panel2.add(quantity);
      panel2.add(quantityText);
      
      panel3 = new JPanel();
      this.add(panel3, BorderLayout.SOUTH);
      panel3.add(add);
      panel3.add(done);
      panel3.add(cancel);
      
      this.setVisible(true);
      this.pack();
      this.setResizable(false);
   }
   
}
